package com.icss.vo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.icss.common.vo.BasePojo;

/**
 * 用户的pojo
 * @author 陈岩
 */
public class MakeupUsers extends BasePojo<MakeupUsers>
{
	private int id;
	private String email;
	private String pass;
	private String nick;
	private String name;
	private String phone;
	private String addr;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date lastLoginTime;

	private String statusStr;
	
	/* 存储所有状态的容器 */
	private Map<String,String> enumsMap = new TreeMap<String, String>();
	
	public Map<String, String> getEnumsMap()
	{
		// 根据状态值获取字符串描述
		MakeupUsersEnum[] usersEnums = MakeupUsersEnum.values();
		for (int i = 0; i < usersEnums.length; i++)
		{
			MakeupUsersEnum usersEnum = usersEnums[i];
			String key = usersEnum.toString() ; 
			enumsMap.put(key + "-" + usersEnum.getStatus() + "", usersEnum.getName());
		}
		return enumsMap;
	}

	public String getStatusStr()
	{
		MakeupUsersEnum[] values = MakeupUsersEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			MakeupUsersEnum usersEnumTemp = values[i];
			/*
			 * toString:变量名 name:枚举的键, getstatus:枚举的值
			 */
			if (usersEnumTemp.toString().startsWith("STATUS"))
			{
				if (usersEnumTemp.getStatus() == this.status)
				{
					this.statusStr = usersEnumTemp.getName();
				}
			}
			// System.out.println(adminsEnumTemp.getName() + "=====>" +
			// adminsEnumTemp.getStatus() + "--->" + adminsEnumTemp);
		}
		return statusStr;
	}
	
	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public String getEmail()
	{
		return email;
	}

	public void setEmail(String email)
	{
		this.email = email;
	}

	public String getPhone()
	{
		return phone;
	}

	public void setPhone(String phone)
	{
		this.phone = phone;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getLastLoginTime()
	{
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime)
	{
		this.lastLoginTime = lastLoginTime;
	}

	public String getPass()
	{
		return pass;
	}

	public void setPass(String pass)
	{
		this.pass = pass;
	}

	public String getNick()
	{
		return nick;
	}

	public void setNick(String nick)
	{
		this.nick = nick;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getAddr()
	{
		return addr;
	}

	public void setAddr(String addr)
	{
		this.addr = addr;
	}
}
